/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view.GUI.actions;

import controller.commands.ReplaceConnectionCommand;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import model.graphic.objects.GConnection;
import view.GUI.graphic.GraphicView;

/**
 *
 * @author Ben
 */
public class ReplaceConnectionAction extends AbstractAction{
    private GConnection connection;
    private GraphicView gv;

    public ReplaceConnectionAction(GConnection connection, GraphicView graphicView) {
        this.connection = connection;
        this.gv = graphicView;
    }

    public void actionPerformed(ActionEvent e) {
        gv.notifyObservers(new ReplaceConnectionCommand(connection));
        gv.repaint();
    }
}
